{% block sw_category_detail_menu %}
<mt-card
    class="sw-category-detail-base__menu"
    position-identifier="sw-category-detail-menu"
    :title="$tc('sw-category.base.menu.title')"
    :is-loading="isLoading"
>

    {% block sw_category_detail_information_visible %}

    <mt-switch
        v-model="reversedVisibility"
        borderd
        :disabled="!acl.can('category.editor')"
        :label="$tc('sw-category.base.menu.visible')"
    />
    {% endblock %}

    {% block sw_category_detail_menu_media %}
    <sw-upload-listener
        :key="category.id + 'uploadListener'"
        :upload-tag="category.id"
        auto-upload
        @media-upload-finish="onSetMediaItem"
    />
    <sw-media-upload-v2
        :key="category.id + 'upload'"
        :label="$tc('sw-category.base.menu.imageLabel')"
        variant="regular"
        :disabled="!acl.can('category.editor')"
        :source="mediaItem"
        :upload-tag="category.id"
        :allow-multi-select="false"
        :default-folder="category.getEntityName()"
        @media-drop="onMediaDropped"
        @media-upload-sidebar-open="showMediaModal = true"
        @media-upload-remove-image="onRemoveMediaItem"
    />
    {% endblock %}

    {% block sw_category_detail_menu_media_modal %}
    <sw-media-modal-v2
        v-if="showMediaModal"
        :allow-multi-select="false"
        :entity-context="category.getEntityName()"
        @media-modal-selection-change="onMediaSelectionChange"
        @modal-close="showMediaModal = false"
    />
    {% endblock %}

    {% block sw_category_detail_menu_description %}
    <mt-text-editor
        :key="category.id + 'description'"
        v-model="category.description"
        class="sw-category-detail-base__description"
        type="textarea"
        :disabled="!acl.can('category.editor')"
        sanitize-input
        sanitize-field-name="category_translation.description"
        :label="$tc('sw-category.base.menu.descriptionLabel')"
        :placeholder="$tc('sw-category.base.menu.descriptionPlaceholder')"
    />
    {% endblock %}
</mt-card>
{% endblock %}
